package com.iss.okair.db.mapper;

import com.iss.okair.db.entity.AssetsFinance;
import com.iss.okair.db.entity.Assetstrans;
import com.iss.okair.db.mapper.sql.AssetsFianlSQL;
import com.iss.okair.db.model.AssetsFinalModle;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import java.util.List;

public interface AssetsFinalMapper {
    @SelectProvider(type= AssetsFianlSQL.class,method = "find")
    List<AssetsFinance> select( AssetsFinalModle model);
    @Insert("INSERT INTO  assets_finance VALUES(#{id},#{assetscode},#{assetstype},#{namecn},#{unitamount},#{financetype},#{organization},#{cycle},#{autocycle},#{refbankno},NOW(),#{createuser},#{comment})")
    int add(AssetsFinance  finance);
    @Select("select count(*) from assets_finance")
    int countAll();
    @UpdateProvider(type = AssetsFianlSQL.class, method="update")
    int update(AssetsFinance finance);

}
